unit SUWeb;

interface
  Type
    PWeb = class
      private
        m_URL : String;
        function SinGetBody: String;
        function SinGetHeader: String;
      public
        constructor Create(URL:String);overload;
        constructor Create();overload;

        procedure Get(); overload;
        procedure Get(URL:String);overload;

        function Post(Data:String):String;overload;
        function Post(URL,Data:String):String;overload;

        property Body   : String read SinGetBody;
        property Header : String read SinGetHeader;
        property URL    : String read m_URL         write m_URL;
    end;

implementation
  uses SUStealth;

{ PWeb }

constructor PWeb.Create;
begin
  m_URL := '';
end;

constructor PWeb.Create(URL: String);
begin
  m_URL := URL;
end;

procedure PWeb.Get(URL: String);
begin
  m_URL := URL;
  Get;
end;

procedure PWeb.Get;
begin
  Script.HTTP.Get(URL);
end;

function PWeb.Post(Data: String): String;
begin
  Script.HTTP.Post(URL,Data);
end;

function PWeb.Post(URL, Data: String): String;
begin
  m_URL := URL;
  Post(Data);
end;

function PWeb.SinGetBody: String;
begin
  Result := Script.HTTP.Body;
end;

function PWeb.SinGetHeader: String;
begin
  Result := Script.HTTP.Header;
end;

end.
